package scenes;

import java.awt.Color;
import java.awt.Font;

import com.uqbar.vainilla.DeltaState;
import com.uqbar.vainilla.GameComponent;
import com.uqbar.vainilla.GameScene;
import com.uqbar.vainilla.appearances.Label;
import com.uqbar.vainilla.appearances.Rectangle;
import com.uqbar.vainilla.events.constants.Key;
import components.decoration.Background;
import components.gamelevels.Level1;

public class PresentationScene extends GameScene {

	public PresentationScene(){
		this.addBackground();
		this.addTitleLabel();
		this.addButtonLabel();
	}

	private void addBackground() {
		this.addComponent(new Background(new Rectangle(Color.BLACK, 1000, 600)));
	}

	private void addButtonLabel() {
		GameComponent gc = new GameComponent(){
			public void update(DeltaState delta){
				super.update(delta);
				if (delta.isKeyPressed(Key.ENTER)){
					this.getGame().setCurrentScene(new Level1(1, 0));
				}
			}
		};
		gc.setX(300);
		gc.setY(300);
		gc.setZ(1);
		gc.setAppearance(new Label(new Font(Font.SERIF, Font.PLAIN, 20), Color.WHITE, "Press enter to start"));
		this.addComponent(gc);
		
	}

	private void addTitleLabel() {
		GameComponent gc = new GameComponent();
		gc.setX(200);
		gc.setY(200);
		gc.setZ(1);
		gc.setAppearance(new Label(new Font(Font.SERIF, Font.PLAIN, 40), Color.RED, "GARKANOID"));
		this.addComponent(gc);
		
	}
}
